﻿using System.Collections.Generic;
using System.Linq;
using Newtonsoft.Json;
using WholesaleOnline.Model;

namespace WholesaleOnline.Controller.Extension
{
    public static class KeywordExtensionMethod
    {
        public static dynamic ConvertToComboboxJson(this IEnumerable<WoKeyword> keywords)
        {
            var dynamicObjs = keywords.Select(k => new { value = k.Value });
            return JsonConvert.SerializeObject(dynamicObjs);
        }
    }
}
